package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingClassesRecordMapper;
import com.ruoyi.teaching.domain.TeachingClassesRecord;
import com.ruoyi.teaching.service.ITeachingClassesRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 班级上课记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-25
 */
@Service
public class TeachingClassesRecordServiceImpl implements ITeachingClassesRecordService 
{
    @Autowired
    private TeachingClassesRecordMapper teachingClassesRecordMapper;

    /**
     * 查询班级上课记录
     * 
     * @param claRecordId 班级上课记录主键
     * @return 班级上课记录
     */
    @Override
    public TeachingClassesRecord selectTeachingClassesRecordByClaRecordId(Long claRecordId)
    {
        return teachingClassesRecordMapper.selectTeachingClassesRecordByClaRecordId(claRecordId);
    }

    /**
     * 查询班级上课记录列表
     * 
     * @param teachingClassesRecord 班级上课记录
     * @return 班级上课记录
     */
    @Override
    public List<TeachingClassesRecord> selectTeachingClassesRecordList(TeachingClassesRecord teachingClassesRecord)
    {
        return teachingClassesRecordMapper.selectTeachingClassesRecordList(teachingClassesRecord);
    }

    /**
     * 新增班级上课记录
     * 
     * @param teachingClassesRecord 班级上课记录
     * @return 结果
     */
    @Override
    public int insertTeachingClassesRecord(TeachingClassesRecord teachingClassesRecord)
    {
        teachingClassesRecord.setCreateTime(DateUtils.getNowDate());
        return teachingClassesRecordMapper.insertTeachingClassesRecord(teachingClassesRecord);
    }

    /**
     * 修改班级上课记录
     * 
     * @param teachingClassesRecord 班级上课记录
     * @return 结果
     */
    @Override
    public int updateTeachingClassesRecord(TeachingClassesRecord teachingClassesRecord)
    {
        teachingClassesRecord.setUpdateTime(DateUtils.getNowDate());
        return teachingClassesRecordMapper.updateTeachingClassesRecord(teachingClassesRecord);
    }

    /**
     * 批量删除班级上课记录
     * 
     * @param claRecordIds 需要删除的班级上课记录主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassesRecordByClaRecordIds(String claRecordIds)
    {
        return teachingClassesRecordMapper.deleteTeachingClassesRecordByClaRecordIds(Convert.toStrArray(claRecordIds));
    }

    /**
     * 删除班级上课记录信息
     * 
     * @param claRecordId 班级上课记录主键
     * @return 结果
     */
    @Override
    public int deleteTeachingClassesRecordByClaRecordId(Long claRecordId)
    {
        return teachingClassesRecordMapper.deleteTeachingClassesRecordByClaRecordId(claRecordId);
    }
}
